// Camera.h

#ifndef CAMERA_H_INCLUDED
#define CAMERA_H_INCLUDED

class SoundListener;
class Camera {
public:
	Camera();
	virtual ~Camera(void){}
	void Update();

	void MoveForward(float amount);
	void MoveSideways(float amount);
	void MoveUp(float amount);
	void RotateX(float amount);
	void RotateY(float amount);
	void RotateZ(float amount);

	void SetPerspective(float aspect,float fov,float znear,float zfar);
	void SetSoundListener(SoundListener* sound_listener) { m_sound_listener = sound_listener; }
	void SetFreeCamera(bool free) { m_free_camera = free; }
	void SetPosition(Vec3 position) { m_position = position; }
	bool IsFreeCamera() const { return m_free_camera; }
	void SetBoundingArea(float top, float bottom, float left, float right);

	Mat4 GetProj();
	Mat4 GetView();
	Vec3 GetPosition() const;

private:
	bool m_dirty;
	bool m_free_camera;

	float m_yaw;
	float m_pitch;
	float m_roll;

	Vec3 m_right;
	Vec3 m_up;
	Vec3 m_forward;
	Vec3 m_position;
	float m_bounding_area_top;
	float m_bounding_area_bottom;
	float m_bounding_area_left;
	float m_bounding_area_right;

	Mat4 m_view;
	Mat4 m_proj;
	SoundListener* m_sound_listener;
};

#endif // CAMERA_H_INCLUDED
